home *** CD-ROM | disk | FTP | other *** search
- ;MARK.ASM - mark a position in memory,
- ; above which TSRs will later be cleared by RELEASE.COM
- ; MARK can be called multiple times, each RELEASE will clear
- ; above the last MARK called.
- ;
- ; VERSION 1.4 2/23/86
- ; This version also stores the EMS page map so that RELEASE can release
- ; READY! and any future resident programs using expanded memory
- ; VERSION 1.5 2/28/86
- ; to keep consistent with MAPMEM and RELEASE
- ; VERSION 1.6 3/8/86
- ; store all 256 interrupts, but only 32 EMS blocks
- ;
- ; If MARK is called with something on the command line, that text will
- ; be stored in the program segment prefix at offset 80H, where it is
- ; later accessible to RELEASE for a "named" release.
- ;
- ; written for CHASM (CHeap ASseMbler)
- ; by Kim Kokkonen, TurboPower Software
- ; telephone: 408-378-3672, Compuserve 72457,2131
- ;
- mark proc near
- jmp install
-
- idstr db 'MARK PARAMETER BLOCK FOLLOWS' ;used to find this TSR
- dummy db 0 ;puts vector table on an even paragraph boundary
- vector ds 400H,0 ;holds vector table (0..FF)*4 at invocation time
- emscnt db 0,0 ;holds number of active pages in map that follows
- emsmap ds 80H,0 ;holds EMS page map if installed
-
- install
-
- ;store the interrupt vector table
- push ds
- mov cx,200H ;512 integers to store
- xor ax,ax
- mov ds,ax ;source address segment 0
- xor si,si ;offset 0
- mov di,offset(vector) ;destination offset, es=cs already
- cld ;copy up
- rep
- movsw ;copy vectors to our table
-
- ;determine whether EMS is present
- pop ds
- mov dx,offset(emsnm)
- mov ax,3D00H
- int 21H
- jb gores ;ems driver not installed
-
- ;EMS present, store the page map
- mov ah,4DH
- mov di,offset(emsmap) ;es=cs already
- xor bx,bx
- int 67H
- cmp ah,0
- jnz gores ;error, ignore this step
-
- ;store the number of active handles
- mov emscnt,bx ;count of active handles
-
- ;print message and TSR
- gores mov dx,offset(didit)
- mov ah,9
- int 21H ;write success message
- mov dx,offset(install) ;get end of resident portion
- mov cx,4
- shr dx,cl ;convert to paragraphs
- inc dx ;round up
- mov ax,3100H
- int 21H ;terminate and stay resident
- endp
-
- ;success message and version number
- didit db 13,10,'MARK 1.6 - Marked current memory position',13,10,36
- ;file name for testing EMS presence
- emsnm db 'EMMXXXX0',0